// pages/login/login.js
const app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    auid:'admin',
    token:'admin',
  },
  onLoad: function (options) {

  },
  formSubmit: function (e) {
    const auid = e.detail.value.auid;
    const token = e.detail.value.token;
    if(!auid || !token){
      // Toast.show('SDK用户账号或密码为空.');
      wx.showToast({title: '请输入信息'});
      return;
    }

    const eventChannel = this.getOpenerEventChannel();
    eventChannel.emit('onLogin', {auid: auid, token: token});
    wx.navigateBack({delta:1});
  },


});
